package dm1101.demo03;

/**
 * @author Ln
 * @version 终极版
 * @date 2022/11/1 16:32
 */
public class Girl extends Thread{
    @Override
    public void run() {
        synchronized (Lock.lock2){
            System.out.println(Thread.currentThread().getName()+"获取一根筷子");
            synchronized (Lock.lock1){
                System.out.println(Thread.currentThread().getName()+"获取另一根筷子");
                System.out.println(Thread.currentThread().getName()+"吃饭");
            }
        }
    }
}
